package thread;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ThreadDemo33 {
    public static void main(String[] args) {
        ExecutorService service = Executors.newFixedThreadPool(5);
        for(int i = 0; i < 10; i++){
            int n = i;
            service.submit(new Runnable() {
                @Override
                public void run() {
                    System.out.println("数" + n + "被线程" + Thread.currentThread().getName());
                }
            });
        }
    }
}
